home *** CD-ROM | disk | FTP | other *** search
- Path: peer-news.britain.eu.net!strath-cs!st-and!pasta!ks2
- From: ks2@st-and.ac.uk (Keith Sibson)
- Newsgroups: comp.lang.c++
- Subject: cout stupidity
- Date: 11 Jan 1996 13:06:56 GMT
- Organization: University of St. Andrews
- Distribution: world
- Message-ID: <4d321g$eal@calvin.st-and.ac.uk>
- Reply-To: ks2@st-and.ac.uk
- NNTP-Posting-Host: pasta.st-and.ac.uk
- NNTP-Posting-User: ks2
-
-
- #include <iostream.h>
-
- int count=10;
-
- main()
- {
- for(i=0;i<cout;i++) {.....}
- return(0);
- }
-
- Why does this stupidity compile? (BCC 4.5)
-
- Surely cout is of type ostream? Either there is a dubious operator< that
- takes an int and ostream, or there is some wacky automatic conversions going
- on. Does an ostream cast to an int that is the stream position?
-
- Keith.
-
-